package com.yalemang.photovalut.ui.main.adapter

import com.yalemang.framework.base.BaseVBAdapter
import com.yalemang.photovalut.databinding.ItemMainDrawerBinding
import java.util.HashMap

class MainDrawerAdapter(
    private var itemNameList: ArrayList<String>,
    private var itemDrawableMap: HashMap<String, Int>
) : BaseVBAdapter<String, ItemMainDrawerBinding>(itemNameList) {

    override fun onBindViewHolder(
        holder: CommonViewHolder<ItemMainDrawerBinding>,
        data: String,
        position: Int
    ) {
        holder.binding.ivItemMainDrawer.setImageResource(itemDrawableMap[itemNameList[position]]!!)
        holder.binding.tvItemMainDrawer.text = itemNameList[position]
        holder.itemView.setOnClickListener{
            if (itemClickListener != null) {
                itemClickListener.invoke(data,position)
            }
        }
    }
}